home *** CD-ROM | disk | FTP | other *** search
-
- ///////////////////////////////////////////////////////////////////////////////
- // Copyright 1995 by Potomac Software, Inc. Use of this material is subject to
- // the terms and conditions of the software license agreement.
-
- #ifndef __HTMLPABC_INL__
- #define __HTMLPABC_INL__
-
- ///////////////////////////////////////////////////////////////////////////////
- // Inline methods of TWeblibHtmlAPI class.
-
- inline TWeblibHtmlAPI::TWeblibHtmlAPI()
- {
- m_hParse = NULL;
- }
-
- inline TWeblibHtmlAPI::TWeblibHtmlAPI(LPCSTR lpszFilename,WORD wOptions)
- {
- m_hParse = WLHtmlParseFile(lpszFilename,wOptions);
- }
-
- inline TWeblibHtmlAPI::TWeblibHtmlAPI(LPCSTR lpszBuf,DWORD cbBuf,WORD wOptions)
- {
- if (cbBuf == 0)
- cbBuf = lstrlen(lpszBuf) + sizeof('\0');
- m_hParse = WLHtmlParseBuf(lpszBuf,cbBuf,wOptions);
- }
-
- inline BOOL TWeblibHtmlAPI::IsGood() const
- {
- return m_hParse != NULL;
- }
-
- inline BOOL TWeblibHtmlAPI::ParseFile(LPCSTR lpszFilename,WORD wOptions)
- {
- return (m_hParse = WLHtmlParseFile(lpszFilename,wOptions)) != NULL;
- }
-
- inline BOOL TWeblibHtmlAPI::ParseBuf(LPCSTR lpszBuf,DWORD cbBuf,WORD wOptions)
- {
- if (cbBuf == 0)
- cbBuf = lstrlen(lpszBuf) + sizeof('\0');
- return (m_hParse = WLHtmlParseBuf(lpszBuf,cbBuf,wOptions)) != NULL;
- }
-
- inline HELEMENT TWeblibHtmlAPI::GetChild(HELEMENT hElement) const
- {
- return m_hParse == NULL ? NULL : WLHtmlGetChild(m_hParse,hElement);
- }
-
- inline HELEMENT TWeblibHtmlAPI::GetParent(HELEMENT hElement) const
- {
- return m_hParse == NULL ? NULL : WLHtmlGetParent(m_hParse,hElement);
- }
-
- inline HELEMENT TWeblibHtmlAPI::GetSibling(HELEMENT hElement,WORD wRel) const
- {
- return m_hParse == NULL ? NULL : WLHtmlGetSibling(m_hParse,hElement,wRel);
- }
-
- inline UINT TWeblibHtmlAPI::GetElementType(HELEMENT hElement) const
- {
- return m_hParse == NULL ? 0 : WLHtmlGetElementType(m_hParse,hElement);
- }
-
- inline LPCSTR TWeblibHtmlAPI::GetElementText(HELEMENT hElement) const
- {
- return m_hParse == NULL ? NULL : WLHtmlGetElementText(m_hParse,hElement);
- }
-
- inline DWORD TWeblibHtmlAPI::GetTextAttr(HELEMENT hElement) const
- {
- return m_hParse == NULL ? 0L : WLHtmlGetTextAttr(m_hParse,hElement);
- }
-
- inline LPCSTR TWeblibHtmlAPI::GetTagName(HELEMENT hElement) const
- {
- return m_hParse == NULL ? NULL : WLHtmlGetTagName(m_hParse,hElement);
- }
-
- inline UINT TWeblibHtmlAPI::GetTagType(HELEMENT hElement) const
- {
- return m_hParse == NULL ? 0 : WLHtmlGetTagType(m_hParse,hElement);
- }
-
- inline HTAGATTR TWeblibHtmlAPI::GetTagAttr(HELEMENT hElement,HTAGATTR hTagAttr,WORD *pwType,
- LPSTR lpszAttr,UINT cbAttr,LPSTR lpszValue,UINT cbValue) const
- {
- return m_hParse == NULL ? NULL : WLHtmlGetTagAttr(m_hParse,hElement,hTagAttr,pwType,
- lpszAttr,cbAttr,lpszValue,cbValue);
- }
-
- inline LPCSTR TWeblibHtmlAPI::ExtractTagAttr(HELEMENT hElement,LPSTR lpszAttr) const
- {
- return m_hParse == NULL ? NULL : WLHtmlExtractTagAttr(m_hParse,hElement,lpszAttr);
- }
-
- inline HELEMENT TWeblibHtmlAPI::FindText(HELEMENT hElement,LPCSTR lpszText) const
- {
- return m_hParse == NULL ? NULL : WLHtmlFindText(m_hParse,hElement,lpszText);
- }
-
- inline HELEMENT TWeblibHtmlAPI::FindSpecial(HELEMENT hElement,LPCSTR lpszSpecial) const
- {
- return m_hParse == NULL ? NULL : WLHtmlFindSpecial(m_hParse,hElement,lpszSpecial);
- }
-
- inline HELEMENT TWeblibHtmlAPI::FindComment(HELEMENT hElement,LPCSTR lpszCommentText) const
- {
- return m_hParse == NULL ? NULL : WLHtmlFindComment(m_hParse,hElement,lpszCommentText);
- }
-
- inline HELEMENT TWeblibHtmlAPI::FindTagType(HELEMENT hElement,UINT nType) const
- {
- return m_hParse == NULL ? NULL : WLHtmlFindTagType(m_hParse,hElement,nType);
- }
-
- inline HELEMENT TWeblibHtmlAPI::FindTagName(HELEMENT hElement,LPCSTR lpszTag) const
- {
- return m_hParse == NULL ? NULL : WLHtmlFindTagName(m_hParse,hElement,lpszTag);
- }
-
- inline HELEMENT TWeblibHtmlAPI::FindTagAttr(HELEMENT hElement,UINT nType,LPCSTR lpszAttr,
- LPCSTR lpszValue) const
- {
- return m_hParse == NULL ? NULL : WLHtmlFindTagAttr(m_hParse,hElement,nType,lpszAttr,lpszValue);
- }
-
- ///////////////////////////////////////////////////////////////////////////////
- // Inline methods of TWeblibHtml class.
-
- #ifndef WEBLIB_NO_OWL
-
- inline BOOL TWeblibHtml::IsGood() const
- {
- return TWeblibHtmlAPI::IsGood() && m_pWindow != NULL && m_pWindow->HWindow != NULL;
- }
-
- inline BOOL TWeblibHtml::EnumParseTree(UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- TWeblibHtmlAPI::EnumParseTree(m_pWindow->HWindow,WM_WEBLIB_ENUMPARSETREE) &&
- PopEnumStack();
- }
-
- inline BOOL TWeblibHtml::EnumFindText(HELEMENT hElement,LPCSTR lpszText,UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- TWeblibHtmlAPI::EnumFindText(hElement,lpszText,m_pWindow->HWindow,
- WM_WEBLIB_ENUMFINDTEXT) &&
- PopEnumStack();
- }
-
- inline BOOL TWeblibHtml::EnumFindSpecial(HELEMENT hElement,LPCSTR lpszSpecial,UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- TWeblibHtmlAPI::EnumFindSpecial(hElement,lpszSpecial,m_pWindow->HWindow,
- WM_WEBLIB_ENUMFINDSPEC) &&
- PopEnumStack();
- }
-
- inline BOOL TWeblibHtml::EnumFindComment(HELEMENT hElement,LPCSTR lpszComment,UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- TWeblibHtmlAPI::EnumFindComment(hElement,lpszComment,m_pWindow->HWindow,
- WM_WEBLIB_ENUMFINDCOMM) &&
- PopEnumStack();
- }
-
- inline BOOL TWeblibHtml::EnumFindTagType(HELEMENT hElement,UINT nType,UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- TWeblibHtmlAPI::EnumFindTagType(hElement,nType,m_pWindow->HWindow,
- WM_WEBLIB_ENUMFINDTAGTYPE) &&
- PopEnumStack();
- }
-
- inline BOOL TWeblibHtml::EnumFindTagName(HELEMENT hElement,LPCSTR lpszTag,UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- TWeblibHtmlAPI::EnumFindTagName(hElement,lpszTag,m_pWindow->HWindow,
- WM_WEBLIB_ENUMFINDTAGNAME) &&
- PopEnumStack();
- }
-
- inline BOOL TWeblibHtml::EnumFindTagAttr(HELEMENT hElement,UINT nType,LPCSTR lpszAttr,
- LPCSTR lpszValueText,UINT nEnumID)
- {
- return IsGood() &&
- PushEnumStack(nEnumID) &&
- TWeblibHtmlAPI::EnumFindTagAttr(hElement,nType,lpszAttr,lpszValueText,
- m_pWindow->HWindow,WM_WEBLIB_ENUMFINDTAGATTR) &&
- PopEnumStack();
- }
-
- #endif // WEBLIB_NO_OWL
-
- #endif
-